package com.example.controller;

import com.example.entity.Connect;
import com.example.entity.Message;

import com.example.service.MessageService;
import com.example.service.Sample;
import com.example.utils.AjaxResult;
import com.example.utils.BaiduConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("ai")
public class Aicontroller {


    @GetMapping("/getConnect")
    public AjaxResult getConnect() {
        Connect connect = Sample.getConnect();
        return AjaxResult.success(connect);
    }

    @GetMapping("/getMessage")
    public AjaxResult getMessage() {
        Message message = new Message();
        message.setApp_id(BaiduConstant.APPID);
        message.setConversation_id("f9a01d3f-4575-4c5c-bb68-1721ee6f1df7");
        message.setQuery("小作坊数量");
        message.setStream(true);
        message.setEnd_user_id("ZZDDDRQ23332");
        MessageService.getMessage(message);
        return AjaxResult.success(message);
    }


}
